/**
 * @author LKQ
 * @date 2022/1/3 9:54
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        solution.dayOfTheWeek(3, 1, 2022);
    }

    public String dayOfTheWeek(int day, int month, int year) {
        String[] week = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
        // 因为12月计算1-11月的天数再加上12月当月天数，所以数组只要前11月天数即可
        int[] monthday = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};
        // 输入年份之前的年份的天数贡献
        int days = 365 * (year - 1971) + (year - 1969) / 4;
        // 输入年份中，输入月份之前的月份的天数贡献
        for (int i = 0; i < month - 1; i++) {
            days += monthday[i];
        }
        if ((year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) && month >= 3) {
            days += 1;
        }
        // 输入月份中的天数贡献
        days += day;
        return week[(days + 3) % 7];
    }
}
